<?php
use common\service\GlobalUrlService;

?>
<!DOCTYPE HTML>
<html lang="en-US">

<head>
    <meta charset="UTF-8">
    <title>ueditor demo</title>
</head>

<body>
<h3>ueditor demo</h3>
<script src="<?= GlobalUrlService::buildStaticUrl('/js/ueditor/ueditor.config.js')?>"></script>
<script src="<?= GlobalUrlService::buildStaticUrl('/js/ueditor/ueditor.all.js')?>"></script>
<script src="<?= GlobalUrlService::buildStaticUrl('/js/jquery-1.8.2.min.js')?>"></script>
<!-- 加载编辑器的容器 -->
<script id="container" name="content" type="text/plain">
        这里写你的初始化内容
    </script>

<button class="save">保存</button>
<!-- 实例化编辑器 -->
<script type="text/javascript">
    var ue = UE.getEditor('container',<?=$toolbars?>);

    //获取内容
    $('.save').on('click',function(){
//        var content = UE.getEditor('container').getContent();
        var content = '<p>&nbsp; &nbsp; &nbsp; &nbsp;这里写你的初始化内容 &nbsp; &nbsp; 挂号费多个省份的施工方式<img src="http://p57o6j7pc.bkt.clouddn.com/20db27e9f9fbcfd6b7765638757293f6.jpg" title="20db27e9f9fbcfd6b7765638757293f6.jpg" alt="ecb3eca5ccedabee338caf7700d329d1.jpg"/></p>';
        $.ajax({
            'type':'POST',
            'url':'/ueditor/add',
            'data':{
                content:content,
            },
            'dataType':'json',
            'success':function(data)
            {
                console.dir(data);
            }
        });

    });
</script>
</body>

</html>
